//
//  HDRootTableViewCell.m
//  qiJi
//
//  Created by 凤利史 on 2018/3/27.
//  Copyright © 2018年 sunrose. All rights reserved.
//

#import "HDRootTableViewCell.h"

@implementation HDRootTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"identifier"]) {
        self.backgroundColor = CLColor(245, 245, 245);
        [self creationView];
        
        
        
    }
    
    return self;
}
- (void)creationView{
    UIView *rootView = [[UIView alloc] init];
    [self addSubview:rootView];
    
    rootView.backgroundColor = [UIColor whiteColor];
    [rootView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self);
        make.right.equalTo(self);
        make.top.equalTo(self).with.offset(10);
        make.bottom.equalTo(self);
    }];
   
    self.imgView = [[UIImageView alloc] init];
    [rootView addSubview:self.imgView];
    [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(rootView).with.offset(10);
        make.left.equalTo(rootView).with.offset(25);
        make.right.equalTo(rootView).with.offset(-25);
        make.height.offset(150*CHANGE_SIZE);
        
    }];
    self.imgView.backgroundColor = [UIColor orangeColor];
    
    self.titLabel = [[UILabel alloc] init];
    [rootView addSubview:self.titLabel];
    self.titLabel.text = @"2018年SHIMANO&TREK杯山地自行车赛1231231231233asdfasdf";
    self.titLabel.font = [UIFont systemFontOfSize:14];
    self.titLabel.textColor = getColor(@"666666");
    [self.titLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(rootView).with.offset(25);
        make.right.equalTo(rootView).with.offset(-25);
        make.top.equalTo(self.imgView.mas_bottom).with.offset(10);
        make.height.offset(14*CHANGE_SIZE);
    }];
    
    UIView *line = [[UIView alloc] init];
    [rootView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(rootView).with.offset(25);
        make.right.equalTo(rootView).with.offset(-25);
        make.top.equalTo(self.titLabel.mas_bottom).with.offset(8);
        make.height.offset(1*CHANGE_SIZE);
        
    }];
    line.backgroundColor = getColor(@"E6E6E6");
    
    self.styleLabel = [[UILabel alloc] init];
    [rootView addSubview:self.styleLabel];
    self.styleLabel.text = @"进行中 截止报名结束200天";
    [self.styleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(rootView).with.offset(25);
        make.top.equalTo(line.mas_bottom).with.offset(10);
        make.height.offset(13*CHANGE_SIZE);
    }];
    self.styleLabel.font = [UIFont systemFontOfSize:13*CHANGE_SIZE];
    self.styleLabel.textColor = getColor(@"999999");
    
    self.baoMingLab = [[UILabel alloc] init];
    [rootView addSubview:self.baoMingLab];
    self.baoMingLab.text = @"200人报名";
    self.baoMingLab.textColor = getColor(@"999999");
    [self.baoMingLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(rootView).with.offset(-25);
        make.top.equalTo(line.mas_bottom).with.offset(10);
        make.height.offset(13*CHANGE_SIZE);
        
    }];
    self.baoMingLab.font = [UIFont systemFontOfSize:13*CHANGE_SIZE];
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
